<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>讲师团队</title>
    <link rel="stylesheet" href="__MOBILE__/css.css">
    <link rel="stylesheet" href="__MOBILE__/sy.css">
    <script type="text/javascript" src="__MOBILE__/w_rem.js" ></script>
    <script src="__MOBILE__/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script></head>
<body>
<div id="data">

</div>
<div id="no_more">

</div>
</body>
</html>
<script>
    $(function(){
        var list_rows = {$list_rows};
        var page = 2;
        var is_data = true;
        var status = {:input('status',0)};
        $(window).scroll(function(){
            var scrollTop = $(this).scrollTop();               //滚动条距离顶部的高度
            var scrollHeight = $(document).height();           //当前页面的总高度
            var windowHeight = $(this).height();               //当前可视的页面高度
            if(scrollTop + windowHeight >= scrollHeight)  { //距离顶部+当前高度 >=文档总高度 即代表滑动到底部
                var _this = $(".pro-ul");

                if(page > {$data->lastPage()}) {
                    //alert('后面没有数据了！');

                    if(is_data){
                        layer.msg('没有数据了');
                    }
                    is_data = false;
                    // $("#no_more").text('没有数据了亲...');
                    return false;
                }else {
                    data(page,list_rows);
                    page += 1;
                }

            }

        })
        data(1,list_rows);
        function data(page,list_rows) {
            $.ajax({
                type: "POST", //用POST方式传输
                dataType: "json", //数据格式:JSON
                data:{page:page,list_rows:list_rows},
                url: "{:url('ajax')}", //目标地址
                async: false,
                success: function (ret) {
                    if(ret.code == 200){
                        var str = '';
                        $.each(ret.data.data, function(k, v) {
                            console.log(v);
                            str += '<div class="team_content"><a onclick="view('+v.id+')">' +
                                '            <div class="team_content_img"><img src="'+v.single_pic+'"></div>' +
                                '            <div class="team_content_right">' +
                                '                <div class="team_content_right1">' +
                                '                    <div class="team_content_right1_left">'+v.title+'</div>' +
                                '                    <div class="team_content_right1_right">'+v.type_title+'</div>' +
                                '                </div>' +
                                '                <div class="team_content_right2">'+v.describe+'</div>' +
                                '            </div>' +
                                '        </a></div>';

                        });
                        $("#data").append(str);

                    }else{

                    }
                }
            });
        }

    })



    function view(id) {
        window.location.href = "{:url('view')}?id="+id;
    }
</script>
<style>
    #data{ text-align: center}
</style>